![]() |
PATH![]() |
![]() ![]() |
Gets the next buffer of data in a download operation.
OSStatus URLGetBuffer (
URLReference urlRef,
void** buffer,
Size *bufferSize);
The URLGetBuffer function obtains the next buffer of data in a download operation. The URLGetBuffer function is used by applications that call URLOpen with a fileSpec parameter that is NULL and that do not need to retain or modify the transferred data.
Each buffer returned by URLGetBuffer is provided by the URL Access Manager, so your application should call URLReleaseBuffer URLReleaseBuffer as soon as possible to prevent the URL Access Manager from running out of buffers.
You should call URLGetBuffer repeatedly until your notification callback routine returns kURLCompletedEvent or kURLAbortInitiatedEvent , or until URLGetStatus returns kURLTransactionComplete or kURLAbortingState . Between calls to URLGetBuffer , you should call URLIdle to allow time for the URL Access Manager to refill its buffers.
WARNING
The data in the buffer returned by URLGetBuffer cannot be modified or retained for a long period of time. You should release the buffer as soon as possible by calling URLReleaseBuffer URLReleaseBuffer .